app_name='main'
from django.urls import path
from . import views

urlpatterns = [
    path('', views.index, name='index'),
    path('save-record/', views.save_daily_record, name='save_daily_record'),
    path('history/', views.history, name='history'),
    path('preferences/', views.preferences, name='preferences'),
    path('food-library/', views.food_library, name='food_library'),
    path('add-food/', views.add_food, name='add_food'),

    path('tags/', views.tag_list, name='tag_list'),
    path('tags/create/', views.tag_create, name='tag_create'),
    path('tags/<int:tag_id>/edit/', views.tag_edit, name='tag_edit'),
    path('tags/<int:tag_id>/delete/', views.tag_delete, name='tag_delete'),
    path('tags/<int:tag_id>/', views.tag_detail, name='tag_detail'),
    path('api/tags/', views.get_tags_json, name='get_tags_json'),
    path('api/food-search/', views.food_search_api, name='food_search_api'),
    path('food-detail/<int:food_id>/', views.food_detail_json, name='food_detail_json'),

    # 做菜指南相关URL
    path('recipes/', views.recipe_list, name='recipe_list'),
    path('recipes/create/', views.recipe_create, name='recipe_create'),
    path('recipes/<int:recipe_id>/', views.recipe_detail, name='recipe_detail'),
    path('recipes/<int:recipe_id>/edit/', views.recipe_edit, name='recipe_edit'),
    path('recipes/<int:recipe_id>/delete/', views.recipe_delete, name='recipe_delete'),
    
    # 菜谱相关URL
    path('caipu/', views.caipu_list, name='caipu_list'),
    path('caipu/<int:caipu_id>/', views.caipu_detail, name='caipu_detail'),

]